// vue cli的 webpack配置文件
const path = require('path')

function resolve (dir) {
  return path.join(__dirname, dir)
}

module.exports = {
  baseUrl: '/',
  outputDir: 'dist',
  devServer: {
    // open: process.platform === 'darwin',
    host: '0.0.0.0',
    port: 8080,
    https: false,
    hotOnly: false,
    disableHostCheck: true,
    // See https://github.com/vuejs/vue-cli/blob/dev/docs/cli-service.md#configuring-proxy
    proxy: {
      '/api': {
        target: 'http://localhost:8080/mock',
        secure: false,
      },
    }, // string | Object
  },
  chainWebpack: config => {
    config.resolve.alias
    .set("assets", resolve('src/assets')) // key,value自行定义，比如.set('@@', resolve('src/components'))
  }
}